package com.karal.javase.cher03;

/**
 * @TODO
 * @Author xu
 * 2025/3/6
 */
public class Employee extends Person implements Add{
    private String ID;
    private double wage;
    private int yearsOfService;

    // 构造方法
    public Employee(String name, String address, String ID, double wage, int yearsOfService) {
        super(name, address);
        this.ID = ID;
        this.wage = wage;
        this.yearsOfService = yearsOfService;
    }

    public Employee() {
        super();
    }

    public Employee(String ID, double wage, int yearsOfService) {
        super();
        this.ID = ID;
        this.wage = wage;
        this.yearsOfService = yearsOfService;
    }

    @Override
    public void increaseSalary() {
        wage *= 1.10; // 普通员工涨10%
    }

    @Override
    public String toString() {
        return "员工信息: 姓名: " + getName() + ", 地址: " + getAddress() +
                ", 工号: " + ID + ", 工资: " + wage + ", 工龄: " + yearsOfService;
    }


    /**
     * 获取
     * @return ID
     */
    public String getID() {
        return ID;
    }

    /**
     * 设置
     * @param ID
     */
    public void setID(String ID) {
        this.ID = ID;
    }

    /**
     * 获取
     * @return wage
     */
    public double getWage() {
        return wage;
    }

    /**
     * 设置
     * @param wage
     */
    public void setWage(double wage) {
        this.wage = wage;
    }

    /**
     * 获取
     * @return yearsOfService
     */
    public int getYearsOfService() {
        return yearsOfService;
    }

    /**
     * 设置
     * @param yearsOfService
     */
    public void setYearsOfService(int yearsOfService) {
        this.yearsOfService = yearsOfService;
    }
}
